using Caliburn.Core.Metadata;
using Caliburn.PresentationFramework;
using Caliburn.PresentationFramework.ApplicationModel;
using Microsoft.Practices.ServiceLocation;

namespace HRManager.ViewModels
{
    [Singleton(typeof(ShellViewModel))]
    public class ShellViewModel : MultiPresenter
    {
        private PresenterManager _center;
        private PresenterManager _bottom;
        private readonly IServiceLocator _serviceLocator;


        public ShellViewModel(IServiceLocator serviceLocator)
        {
            this._serviceLocator = serviceLocator;
            this._center = new PresenterManager();
            this._bottom = new PresenterManager();
        }

        public IObservableCollection<IPresenter> Center
        {
            get
            {
                return this._center.Presenters;
            }
        }

        protected override void OnInitialize()
        {
            base.OnInitialize();
            this.Open(_center);
        }

        public override void Activate()
        {
            base.Activate();
            //this._center.Open(this._serviceLocator.GetInstance<CurriculumVitaeViewModel>());
            this._center.Open(this._serviceLocator.GetInstance<TrainingCourseViewModel>());
        }
    }
}